package com.lsk.pc;

import com.jfinal.aop.Before;
import com.jfinal.aop.Clear;
import com.jfinal.core.Controller;
import com.lsk.common.interceptor.CacheInterceptor;
import com.lsk.util.ReturnData;

import java.util.Map;
@Clear
public class PcController  extends Controller {

    PcService pcService=new PcService();
    /**
     * 注册
     */
    @Before(CacheInterceptor.class)
    public void register() {
        Map<String, String[]> map = getParaMap();    //userCode和password
        ReturnData rd = pcService.register(map);
        renderJson(rd);
    }

    /**
     * 登录
     */
    @Before(CacheInterceptor.class)
    public void login() {

        Map<String, String[]> map = getParaMap();//userCode和password

        ReturnData rd = pcService.loginService(map);

        setCookie("type", "7", 60 ^ 60 * 24);

        renderJson(rd);

    }

}
